﻿import QtQuick 2.12
import QtQuick.Controls 2.12

ToolTip{
    id: root
    property int colorflag: 1
    visible: false
    delay: 500
    text: "333"
    Rectangle{

    }

    contentItem: Text{
        text: root.text
        color: colorflag===1?"white":"black"
        font.pixelSize: config.fontsize - 2*dp
    }

    background: Rectangle{
        radius: 3*dp
        color: colorflag===1?Qt.rgba(0, 0, 0, 0.8):Qt.rgba(255, 255, 255, 1)
    }
    // 过渡效果
    enter: Transition {
        NumberAnimation {
            property: "opacity"
            from: 0
            to: 0.9
            duration: 100
            easing.type: Easing.InOutQuad
        }
    }
    exit: Transition {
        NumberAnimation {
            property: "opacity"
            from: 0.9
            to: 0
            duration: 300
            easing.type: Easing.InOutQuad
        }
    }
}
